Goto

Collaborating Authors

 forest & decision tree decide


How Random Forests & Decision Trees Decide: Simply Explained With An Example In Python

#artificialintelligence

Let's assume that we have a labeled dataset with 10 samples in total. What the Decision Trees do is simple: they find ways to split the data in a way such as that separate as much as possible the samples of the classes (increasing the class separability). In the above example, the perfect split would be a split at x 0.9 as this would lead to 5 red points being at the left side and the 5 blue at the right side (perfect class separability). Each time we split the space/data like that, we actually build a decision tree with a specific rule. Here we initially have the root node containing all the data and then, we split the data at x 0.9 leading to two branches leading to two leaf nodes.